<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class absent extends CI_Controller {

	function absent()
	{
		parent::__construct();
		$this->load->library('session');
		$this->load->library('form_validation');
    $this->load->library('encrypt');
		$this->load->library('enc');
		$this->load->model('mmaster');
                $this->load->model('mservices');
                $this->load->model('mabsent');
		$this->load->model('mglobal');
		$this->is_logged_in();
		#$this->mjadwal->saveLog();
	}
  
  public function index()
  {
  	$this->search();
  }
    function view_absent(){
        $data['template'] = "shell/smooth";
        $data['main_view']      = 'f-absent';
		
		$this->load->view($data['template'],$data);
    }    
        
 
    

    
     function getabsentData(){
        
        
        
        $result=$this->mabsent->getabsentsData();
        
        foreach ($result['aaData'] as $r => &$value) 
        {
            $value[0] = $this->enc->fogit($value[0]);
        }
        
        //penambahan nomor statis untuk grid SSP
        $start=$_GET['iDisplayStart'];
        $result['iDisplayStart']=$start;
		echo json_encode($result);
    }
    
	function is_logged_in()
	{
		$is_logged_in = $this->session->userdata('is_logged_in');
		if(!isset($is_logged_in) || $is_logged_in != true)
		{
			redirect(base_url() .'index.php/login');
		}		
	}
	

	
	





}
?>